<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // 1. 提取日期中的年部分  2015-5-10
    // var dateStr = '2015-1-5';
    // console.log(dateStr.split('-'));

    // var dateStr = '2015/1-5';
    // console.log(dateStr.split(/[/-]/));


    // 2. 提取邮件中的每一部分
    var str = 'xxxx@itcast.com';
    console.log(str.split(/[@\.]/));
    
  </script>
</body>
</html>